package com.hedl.practice.diyJava.log.commons_loggin;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.UnsupportedEncodingException;

/**
 * 第三方日志工具apache
 * 提供了6个日志级别：
 *              info        ==默认级别
 *              debug
 *              error
 *              trace
 *              warn
 *              fatal
 */
public class JavaAndCommonsLogging {
    public static void main(String[] args) {

        Log log = LogFactory.getLog(JavaAndCommonsLogging.class);
        //log.info("start...");
        //log.warn("end...");

        //练习

        log.info("start process...");
        try{
            "".getBytes("invalidCharsetName");
        }catch (UnsupportedEncodingException e){
            log.error("got exception!",e);
        }
        log.info("Process end.");
    }
}
